package cn.zyjw.mapper;

import cn.zyjw.domain.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

public interface SysRoleMapper extends BaseMapper<SysRole> {

    @Select("SELECT sr.`code` FROM sys_role sr LEFT JOIN sys_user_role sur ON sur.role_id = sr.id WHERE sur.user_id = #{userId}")
    String getRoleCodeByUserId(Long userId);
}